function [IN,ON]=InWhich(xo,yo,xElem,yElem)
% close all
% xo=4.6;
% yo=5.6;
 PlotMesh
 PlotCrack
if nargin==2
    global Node Elem
    x=Node(:,2);
    y=Node(:,3);
    ElemNode=Elem(:,2:end);
    xElem=x(ElemNode);
    yElem=y(ElemNode);
end
IN=[];
ON=[];
nElem=size(xElem,1);
for iElem=1:nElem
    xI=xElem(iElem,:);
    yI=yElem(iElem,:);
    [in,on]=inpolygon(xo,yo,xI,yI);
    %     dt=DelaunayTri(xElem,yElem);
    %     si=pointLocation(dt,xo,yo);
    if in
        PlotClosed(xI,yI,'r')
        IN=[IN;iElem];
    end
    if on
        PlotClosed(xI,yI)
        ON=[ON,iElem];
    end
end

hold on
plot(xo,yo,'ro')